home *** CD-ROM | disk | FTP | other *** search
/ BMUG Newsletter 1996 Spring / S96 NL CD.iso / New NL PD Collections / Sound Manager 3.1 / For Programmers / Interfaces / Sound.a next >
Encoding:
Text File  |  1995-08-24  |  25.2 KB  |  902 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Sound.a
  3. ;
  4. ;    Contains:    Sound Manager Interfaces.
  5. ;
  6. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  7. ;                All rights reserved.
  8. ;
  9. ;    Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  10. ;
  11. ;
  12.  
  13.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  14. __SOUND__ SET 1
  15.  
  16.  
  17.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  18.     include 'Types.a'
  19.     ENDIF
  20. ;        include 'ConditionalMacros.a'                                ;
  21.  
  22.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  23.     include 'Components.a'
  24.     ENDIF
  25. ;        include 'MixedMode.a'                                        ;
  26.  
  27.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  28.     include 'MixedMode.a'
  29.     ENDIF
  30. ;
  31. ;                        * * *  N O T E  * * *
  32. ;
  33. ;    This file has been updated to include Sound Manager 3.1 interfaces.
  34. ;
  35. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  36. ;    that originally shipped with the PowerMacs. These missing functions and the
  37. ;    new 3.1 interfaces have been released in the SoundLib library for PowerPC
  38. ;    developers to link with. The runtime library for these functions are
  39. ;    installed by Sound Manager 3.1. The following functions are found in SoundLib.
  40. ;
  41. ;        GetCompressionInfo, GetSoundPreference, SetSoundPreference,
  42. ;        UnsignedFixedMulDiv, SndGetInfo, SndSetInfo
  43. ;
  44. ;
  45. ;    Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  46. ;
  47. ;    These items are no longer defined, but appear here so that someone
  48. ;    searching the interfaces might find them. If you are using one of these
  49. ;    items, you must change your code to support the Sound Manager.
  50. ;
  51. ;        swMode, ftMode, ffMode
  52. ;        FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  53. ;        SndCompletionProcPtr
  54. ;        StartSound, StopSound, SoundDone
  55. ;
  56.  
  57. soundListRsrc                    EQU        'snd '                ;Resource type used by Sound Manager
  58. rate44khz                        EQU        $AC440000            ;44100.00000 in fixed-point
  59. rate22050hz                        EQU        $56220000            ;22050.00000 in fixed-point
  60. rate22khz                        EQU        $56EE8BA3            ;22254.54545 in fixed-point
  61. rate11khz                        EQU        $2B7745D1            ;11127.27273 in fixed-point
  62. rate11025hz                        EQU        $2B110000            ;11025.00000 in fixed-point
  63. ;synthesizer numbers for SndNewChannel
  64. squareWaveSynth                    EQU        1                    ;square wave synthesizer
  65. waveTableSynth                    EQU        3                    ;wave table synthesizer
  66. sampledSynth                    EQU        5                    ;sampled sound synthesizer
  67. ;old Sound Manager MACE synthesizer numbers
  68. MACE3snthID                        EQU        11
  69. MACE6snthID                        EQU        13
  70. kMiddleC                        EQU        60                    ;MIDI note value for middle C
  71. kSimpleBeepID                    EQU        1                    ;reserved resource ID for Simple Beep
  72. kFullVolume                        EQU        $0100                ;1.0, setting for full hardware output volume
  73. kNoVolume                        EQU        0                    ;setting for no sound volume
  74. ;command numbers for SndDoCommand and SndDoImmediate
  75. nullCmd                            EQU        0
  76. initCmd                            EQU        1
  77. freeCmd                            EQU        2
  78. quietCmd                        EQU        3
  79. flushCmd                        EQU        4
  80. reInitCmd                        EQU        5
  81. waitCmd                            EQU        10
  82. pauseCmd                        EQU        11
  83. resumeCmd                        EQU        12
  84. callBackCmd                        EQU        13
  85.  
  86. syncCmd                            EQU        14
  87. availableCmd                    EQU        24
  88. versionCmd                        EQU        25
  89. totalLoadCmd                    EQU        26
  90. loadCmd                            EQU        27
  91. freqDurationCmd                    EQU        40
  92. restCmd                            EQU        41
  93. freqCmd                            EQU        42
  94. ampCmd                            EQU        43
  95. timbreCmd                        EQU        44
  96. getAmpCmd                        EQU        45
  97. volumeCmd                        EQU        46                    ;sound manager 3.0 or later only
  98. getVolumeCmd                    EQU        47                    ;sound manager 3.0 or later only
  99. waveTableCmd                    EQU        60
  100. phaseCmd                        EQU        61
  101.  
  102. soundCmd                        EQU        80
  103. bufferCmd                        EQU        81
  104. rateCmd                            EQU        82
  105. continueCmd                        EQU        83
  106. doubleBufferCmd                    EQU        84
  107. getRateCmd                        EQU        85
  108. rateMultiplierCmd                EQU        86
  109. getRateMultiplierCmd            EQU        87
  110. sizeCmd                            EQU        90
  111. convertCmd                        EQU        91
  112. stdQLength                        EQU        128
  113. dataOffsetFlag                    EQU        $8000
  114.  
  115. ;channel initialization parameters
  116.     IF OLDROUTINENAMES  THEN
  117. waveInitChannelMask                EQU        $07
  118. waveInitChannel0                EQU        $04                    ;wave table only, Sound Manager 2.0 and earlier
  119. waveInitChannel1                EQU        $05                    ;wave table only, Sound Manager 2.0 and earlier
  120. waveInitChannel2                EQU        $06                    ;wave table only, Sound Manager 2.0 and earlier
  121. waveInitChannel3                EQU        $07                    ;wave table only, Sound Manager 2.0 and earlier
  122. initChan0                        EQU        waveInitChannel0    ;obsolete spelling
  123. initChan1                        EQU        waveInitChannel1    ;obsolete spelling
  124. initChan2                        EQU        waveInitChannel2    ;obsolete spelling
  125. initChan3                        EQU        waveInitChannel3    ;obsolete spelling
  126.  
  127.     ENDIF
  128. initChanLeft                    EQU        $0002                ;left stereo channel
  129. initChanRight                    EQU        $0003                ;right stereo channel
  130. initNoInterp                    EQU        $0004                ;no linear interpolation
  131. initNoDrop                        EQU        $0008                ;no drop-sample conversion
  132. initMono                        EQU        $0080                ;monophonic channel
  133. initStereo                        EQU        $00C0                ;stereo channel
  134. initMACE3                        EQU        $0300                ;MACE 3:1
  135. initMACE6                        EQU        $0400                ;MACE 6:1
  136. initPanMask                        EQU        $0003                ;mask for right/left pan values
  137. initSRateMask                    EQU        $0030                ;mask for sample rate values
  138. initStereoMask                    EQU        $00C0                ;mask for mono/stereo values
  139. initCompMask                    EQU        $FF00                ;mask for compression IDs
  140. kUseOptionalOutputDevice        EQU        -1                    ;only for Sound Manager 3.0 or later
  141. notCompressed                    EQU        0                    ;compression ID's
  142. fixedCompression                EQU        -1                    ;compression ID for fixed-sized compression
  143. variableCompression                EQU        -2                    ;compression ID for variable-sized compression
  144. twoToOne                        EQU        1
  145. eightToThree                    EQU        2
  146. threeToOne                        EQU        3
  147. sixToOne                        EQU        4
  148.  
  149.     IF ¬ GENERATINGPOWERPC  THEN
  150. stdSH                            EQU        $00                    ;Standard sound header encode value
  151. extSH                            EQU        $FF                    ;Extended sound header encode value
  152. cmpSH                            EQU        $FE                    ;Compressed sound header encode value
  153.  
  154.     ENDIF
  155. outsideCmpSH                    EQU        0                    ;MACE constants
  156. insideCmpSH                        EQU        1
  157. aceSuccess                        EQU        0
  158. aceMemFull                        EQU        1
  159. aceNilBlock                        EQU        2
  160. aceBadComp                        EQU        3
  161. aceBadEncode                    EQU        4
  162. aceBadDest                        EQU        5
  163. aceBadCmd                        EQU        6
  164. sixToOnePacketSize                EQU        8
  165. threeToOnePacketSize            EQU        16
  166. stateBlockSize                    EQU        64
  167. leftOverBlockSize                EQU        32
  168. firstSoundFormat                EQU        $0001                ;general sound format
  169. secondSoundFormat                EQU        $0002                ;special sampled sound format (HyperCard)
  170. dbBufferReady                    EQU        $00000001            ;double buffer is filled
  171. dbLastBuffer                    EQU        $00000004            ;last double buffer to play
  172. sysBeepDisable                    EQU        $0000                ;SysBeep() enable flags
  173. sysBeepEnable                    EQU        (1 << 0)
  174. sysBeepSynchronous                EQU        (1 << 1)            ;if bit set, make alert sounds synchronous
  175. unitTypeNoSelection                EQU        $FFFF                ;unitTypes for AudioSelection.unitType
  176. unitTypeSeconds                    EQU        $0000
  177.  
  178. ; unsigned fixed-point number
  179. ; typedef unsigned long     UnsignedFixed
  180. SndCommand                 RECORD    0
  181. cmd                         ds.w   1        ; offset: $0 (0)
  182. param1                     ds.w   1        ; offset: $2 (2)
  183. param2                     ds.l   1        ; offset: $4 (4)
  184. sizeof                     EQU *            ; size:   $8 (8)
  185.                         ENDR
  186.  
  187. ; typedef struct SndCommand  SndCommand
  188. ; typedef struct SndChannel  SndChannel
  189. ; typedef SndChannel         *SndChannelPtr
  190. SndChannel                 RECORD    0
  191. nextChan                 ds.l   1        ; offset: $0 (0)
  192. firstMod                 ds.l   1        ; offset: $4 (4)        ; reserved for the Sound Manager
  193. callBack                 ds.l   1        ; offset: $8 (8)
  194. userInfo                 ds.l   1        ; offset: $C (12)
  195. wait                     ds.l   1        ; offset: $10 (16)        ; The following is for internal Sound Manager use only.
  196. cmdInProgress             ds     SndCommand ; offset: $14 (20)
  197. flags                     ds.w   1        ; offset: $1C (28)
  198. qLength                     ds.w   1        ; offset: $1E (30)
  199. qHead                     ds.w   1        ; offset: $20 (32)
  200. qTail                     ds.w   1        ; offset: $22 (34)
  201. queue                     ds.b   128 * SndCommand.sizeof ; offset: $24 (36)
  202. sizeof                     EQU *            ; size:   $424 (1060)
  203.                         ENDR
  204.  
  205. ;MACE structures
  206. StateBlock                 RECORD    0
  207. stateVar                 ds.w   64        ; offset: $0 (0)
  208. sizeof                     EQU *            ; size:   $80 (128)
  209.                         ENDR
  210.  
  211. ; typedef struct StateBlock  StateBlock
  212. ; typedef StateBlock         *StateBlockPtr
  213. LeftOverBlock             RECORD    0
  214. count                     ds.l   1        ; offset: $0 (0)
  215. sampleArea                 ds.b   32        ; offset: $4 (4)
  216. sizeof                     EQU *            ; size:   $24 (36)
  217.                         ENDR
  218.  
  219. ; typedef struct LeftOverBlock  LeftOverBlock
  220. ; typedef LeftOverBlock     *LeftOverBlockPtr
  221. ModRef                     RECORD    0
  222. modNumber                 ds.w   1        ; offset: $0 (0)
  223. modInit                     ds.l   1        ; offset: $2 (2)
  224. sizeof                     EQU *            ; size:   $6 (6)
  225.                         ENDR
  226.  
  227. ; typedef struct ModRef     ModRef
  228. SndListResource         RECORD    0
  229. format                     ds.w   1        ; offset: $0 (0)
  230. numModifiers             ds.w   1        ; offset: $2 (2)
  231. modifierPart             ds     ModRef    ; offset: $4 (4)        ;This is a variable length array
  232. numCommands                 ds.w   1        ; offset: $A (10)
  233. commandPart                 ds     SndCommand ; offset: $C (12)    ;This is a variable length array
  234. dataPart                 ds.b   1        ; offset: $14 (20)        ;This is a variable length array
  235.                          ORG 22
  236. sizeof                     EQU *            ; size:   $16 (22)
  237.                         ENDR
  238.  
  239. ; typedef struct SndListResource  SndListResource
  240. ; typedef SndListResource     *SndListPtr
  241. ; typedef SndListPtr         *SndListHndl, *SndListHandle
  242. ;HyperCard sound resource format
  243. Snd2ListResource         RECORD    0
  244. format                     ds.w   1        ; offset: $0 (0)
  245. refCount                 ds.w   1        ; offset: $2 (2)
  246. numCommands                 ds.w   1        ; offset: $4 (4)
  247. commandPart                 ds     SndCommand ; offset: $6 (6)        ;This is a variable length array
  248. dataPart                 ds.b   1        ; offset: $E (14)        ;This is a variable length array
  249.                          ORG 16
  250. sizeof                     EQU *            ; size:   $10 (16)
  251.                         ENDR
  252.  
  253. ; typedef struct Snd2ListResource  Snd2ListResource
  254. ; typedef Snd2ListResource     *Snd2ListPtr
  255. ; typedef Snd2ListPtr         *Snd2ListHndl, *Snd2ListHandle
  256. SoundHeader             RECORD    0
  257. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if NIL then samples are in sampleArea
  258. length                     ds.l   1        ; offset: $4 (4)        ;length of sound in bytes
  259. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate for this sound
  260. loopStart                 ds.l   1        ; offset: $C (12)        ;start of looping portion
  261. loopEnd                     ds.l   1        ; offset: $10 (16)        ;end of looping portion
  262. encode                     ds.b   1        ; offset: $14 (20)        ;header encoding
  263. baseFrequency             ds.b   1        ; offset: $15 (21)        ;baseFrequency value
  264. sampleArea                 ds.b   1        ; offset: $16 (22)        ;space for when samples follow directly
  265.                          ORG 24
  266. sizeof                     EQU *            ; size:   $18 (24)
  267.                         ENDR
  268.  
  269. ; typedef struct SoundHeader  SoundHeader
  270. ; typedef SoundHeader         *SoundHeaderPtr
  271. CmpSoundHeader             RECORD    0
  272. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  273. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels i.e. mono = 1
  274. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  275. loopStart                 ds.l   1        ; offset: $C (12)        ;loopStart of sound before compression
  276. loopEnd                     ds.l   1        ; offset: $10 (16)        ;loopEnd of sound before compression
  277. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  278. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  279. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in frames ( packetFrames or sampleFrames )
  280. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  281. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  282. format                     ds.l   1        ; offset: $28 (40)        ;data format type, was futureUse1
  283. futureUse2                 ds.l   1        ; offset: $2C (44)        ;reserved by Apple
  284. stateVars                 ds.l   1        ; offset: $30 (48)        ;pointer to State Block
  285. leftOverSamples             ds.l   1        ; offset: $34 (52)        ;used to save truncated samples between compression calls
  286. compressionID             ds.w   1        ; offset: $38 (56)        ;0 means no compression, non zero means compressionID
  287. packetSize                 ds.w   1        ; offset: $3A (58)        ;number of bits in compressed sample packet
  288. snthID                     ds.w   1        ; offset: $3C (60)        ;resource ID of Sound Manager snth that contains NRT C/E
  289. sampleSize                 ds.w   1        ; offset: $3E (62)        ;number of bits in non-compressed sample
  290. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  291.                          ORG 66
  292. sizeof                     EQU *            ; size:   $42 (66)
  293.                         ENDR
  294.  
  295. ; typedef struct CmpSoundHeader  CmpSoundHeader
  296. ; typedef CmpSoundHeader     *CmpSoundHeaderPtr
  297. ExtSoundHeader             RECORD    0
  298. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  299. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels,  ie mono = 1
  300. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  301. loopStart                 ds.l   1        ; offset: $C (12)        ;same meaning as regular SoundHeader
  302. loopEnd                     ds.l   1        ; offset: $10 (16)        ;same meaning as regular SoundHeader
  303. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  304. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  305. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in total number of frames
  306. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  307. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  308. instrumentChunks         ds.l   1        ; offset: $28 (40)        ;AIFF instrument chunks
  309. AESRecording             ds.l   1        ; offset: $2C (44)
  310. sampleSize                 ds.w   1        ; offset: $30 (48)        ;number of bits in sample
  311. futureUse1                 ds.w   1        ; offset: $32 (50)        ;reserved by Apple
  312. futureUse2                 ds.l   1        ; offset: $34 (52)        ;reserved by Apple
  313. futureUse3                 ds.l   1        ; offset: $38 (56)        ;reserved by Apple
  314. futureUse4                 ds.l   1        ; offset: $3C (60)        ;reserved by Apple
  315. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  316.                          ORG 66
  317. sizeof                     EQU *            ; size:   $42 (66)
  318.                         ENDR
  319.  
  320. ; typedef struct ExtSoundHeader  ExtSoundHeader
  321. ; typedef ExtSoundHeader     *ExtSoundHeaderPtr
  322. ConversionBlock         RECORD    0
  323. destination                 ds.w   1        ; offset: $0 (0)
  324. unused                     ds.w   1        ; offset: $2 (2)
  325. inputPtr                 ds.l   1        ; offset: $4 (4)
  326. outputPtr                 ds.l   1        ; offset: $8 (8)
  327. sizeof                     EQU *            ; size:   $C (12)
  328.                         ENDR
  329.  
  330. ; typedef struct ConversionBlock  ConversionBlock
  331. ; typedef ConversionBlock     *ConversionBlockPtr
  332. SMStatus                 RECORD    0
  333. smMaxCPULoad             ds.w   1        ; offset: $0 (0)
  334. smNumChannels             ds.w   1        ; offset: $2 (2)
  335. smCurCPULoad             ds.w   1        ; offset: $4 (4)
  336. sizeof                     EQU *            ; size:   $6 (6)
  337.                         ENDR
  338.  
  339. ; typedef struct SMStatus     SMStatus
  340. ; typedef SMStatus             *SMStatusPtr
  341. SCStatus                 RECORD    0
  342. scStartTime                 ds.l   1        ; offset: $0 (0)
  343. scEndTime                 ds.l   1        ; offset: $4 (4)
  344. scCurrentTime             ds.l   1        ; offset: $8 (8)
  345. scChannelBusy             ds.b   1        ; offset: $C (12)
  346. scChannelDisposed         ds.b   1        ; offset: $D (13)
  347. scChannelPaused             ds.b   1        ; offset: $E (14)
  348. scUnused                 ds.b   1        ; offset: $F (15)
  349. scChannelAttributes         ds.l   1        ; offset: $10 (16)
  350. scCPULoad                 ds.l   1        ; offset: $14 (20)
  351. sizeof                     EQU *            ; size:   $18 (24)
  352.                         ENDR
  353.  
  354. ; typedef struct SCStatus     SCStatus
  355. ; typedef SCStatus             *SCStatusPtr
  356. AudioSelection             RECORD    0
  357. unitType                 ds.l   1        ; offset: $0 (0)
  358. selStart                 ds.l   1        ; offset: $4 (4)
  359. selEnd                     ds.l   1        ; offset: $8 (8)
  360. sizeof                     EQU *            ; size:   $C (12)
  361.                         ENDR
  362.  
  363. ; typedef struct AudioSelection  AudioSelection
  364. ; typedef AudioSelection     *AudioSelectionPtr
  365. SndDoubleBuffer         RECORD    0
  366. dbNumFrames                 ds.l   1        ; offset: $0 (0)
  367. dbFlags                     ds.l   1        ; offset: $4 (4)
  368. dbUserInfo                 ds.l   2        ; offset: $8 (8)
  369. dbSoundData                 ds.b   1        ; offset: $10 (16)
  370.                          ORG 18
  371. sizeof                     EQU *            ; size:   $12 (18)
  372.                         ENDR
  373.  
  374. ; typedef struct SndDoubleBuffer  SndDoubleBuffer
  375. ; typedef SndDoubleBuffer     *SndDoubleBufferPtr
  376. SndDoubleBufferHeader     RECORD    0
  377. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  378. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  379. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  380. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  381. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  382. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  383. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  384. sizeof                     EQU *            ; size:   $18 (24)
  385.                         ENDR
  386.  
  387. ; typedef struct SndDoubleBufferHeader  SndDoubleBufferHeader
  388. ; typedef SndDoubleBufferHeader  *SndDoubleBufferHeaderPtr
  389. SndDoubleBufferHeader2     RECORD    0
  390. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  391. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  392. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  393. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  394. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  395. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  396. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  397. dbhFormat                 ds.l   1        ; offset: $18 (24)
  398. sizeof                     EQU *            ; size:   $1C (28)
  399.                         ENDR
  400.  
  401. ; typedef struct SndDoubleBufferHeader2  SndDoubleBufferHeader2
  402. ; typedef SndDoubleBufferHeader2  *SndDoubleBufferHeader2Ptr
  403. SoundInfoList             RECORD    0
  404. count                     ds.w   1        ; offset: $0 (0)
  405. infoHandle                 ds.l   1        ; offset: $2 (2)
  406. sizeof                     EQU *            ; size:   $6 (6)
  407.                         ENDR
  408.  
  409. ; typedef struct SoundInfoList  SoundInfoList
  410. ; typedef SoundInfoList     *SoundInfoListPtr
  411. CompressionInfo         RECORD    0
  412. recordSize                 ds.l   1        ; offset: $0 (0)
  413. format                     ds.l   1        ; offset: $4 (4)
  414. compressionID             ds.w   1        ; offset: $8 (8)
  415. samplesPerPacket         ds.w   1        ; offset: $A (10)
  416. bytesPerPacket             ds.w   1        ; offset: $C (12)
  417. bytesPerFrame             ds.w   1        ; offset: $E (14)
  418. bytesPerSample             ds.w   1        ; offset: $10 (16)
  419. futureUse1                 ds.w   1        ; offset: $12 (18)
  420. sizeof                     EQU *            ; size:   $14 (20)
  421.                         ENDR
  422.  
  423. ; typedef struct CompressionInfo  CompressionInfo
  424. ; typedef CompressionInfo     *CompressionInfoPtr
  425. ; typedef CompressionInfoPtr  *CompressionInfoHandle
  426. ; These two routines for Get/SetSoundVol should no longer be used.
  427. ; They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  428. ; Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  429.     IF OLDROUTINENAMES  ** ¬ GENERATINGCFM  THEN
  430. ;
  431. ; pascal void SetSoundVol(short level)
  432. ;
  433.     IF GENERATINGCFM THEN
  434.         IMPORT_CFM_FUNCTION    SetSoundVol
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal void GetSoundVol(short *level)
  439. ;
  440.     IF ¬ GENERATINGCFM THEN
  441.         ; parameters:
  442.         ;     level             => A0
  443.         Macro
  444.         _GetSoundVol
  445.             dc.w     $4218
  446.             dc.w     $10B8
  447.             dc.w     $0260
  448.         EndM
  449.     ELSE
  450.         IMPORT_CFM_FUNCTION    GetSoundVol
  451.     ENDIF
  452.  
  453.     ENDIF
  454. ;
  455. ; pascal OSErr SndDoCommand(SndChannelPtr chan, const SndCommand *cmd, Boolean noWait)
  456. ;
  457.     IF ¬ GENERATINGCFM THEN
  458.         _SndDoCommand:    OPWORD    $A803
  459.     ELSE
  460.         IMPORT_CFM_FUNCTION    SndDoCommand
  461.     ENDIF
  462.  
  463. ;
  464. ; pascal OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand *cmd)
  465. ;
  466.     IF ¬ GENERATINGCFM THEN
  467.         _SndDoImmediate:    OPWORD    $A804
  468.     ELSE
  469.         IMPORT_CFM_FUNCTION    SndDoImmediate
  470.     ENDIF
  471.  
  472. ;
  473. ; pascal OSErr SndNewChannel(SndChannelPtr *chan, short synth, long init, SndCallBackUPP userRoutine)
  474. ;
  475.     IF ¬ GENERATINGCFM THEN
  476.         _SndNewChannel:    OPWORD    $A807
  477.     ELSE
  478.         IMPORT_CFM_FUNCTION    SndNewChannel
  479.     ENDIF
  480.  
  481. ;
  482. ; pascal OSErr SndDisposeChannel(SndChannelPtr chan, Boolean quietNow)
  483. ;
  484.     IF ¬ GENERATINGCFM THEN
  485.         _SndDisposeChannel:    OPWORD    $A801
  486.     ELSE
  487.         IMPORT_CFM_FUNCTION    SndDisposeChannel
  488.     ENDIF
  489.  
  490. ;
  491. ; pascal OSErr SndPlay(SndChannelPtr chan, SndListHandle sndHdl, Boolean async)
  492. ;
  493.     IF ¬ GENERATINGCFM THEN
  494.         _SndPlay:    OPWORD    $A805
  495.     ELSE
  496.         IMPORT_CFM_FUNCTION    SndPlay
  497.     ENDIF
  498.  
  499.     IF OLDROUTINENAMES  THEN
  500. ;
  501. ; pascal OSErr SndAddModifier(SndChannelPtr chan, Ptr modifier, short id, long init)
  502. ;
  503.     IF ¬ GENERATINGCFM THEN
  504.         _SndAddModifier:    OPWORD    $A802
  505.     ELSE
  506.         IMPORT_CFM_FUNCTION    SndAddModifier
  507.     ENDIF
  508.  
  509.     ENDIF
  510. ;
  511. ; pascal OSErr SndControl(short id, SndCommand *cmd)
  512. ;
  513.     IF ¬ GENERATINGCFM THEN
  514.         _SndControl:    OPWORD    $A806
  515.     ELSE
  516.         IMPORT_CFM_FUNCTION    SndControl
  517.     ENDIF
  518.  
  519. ; Sound Manager 2.0 and later, uses _SoundDispatch
  520. ; SndSoundManagerVersion() returns a NumVersion
  521. ;
  522. ; pascal unsigned long SndSoundManagerVersion(void)
  523. ;
  524.     IF ¬ GENERATINGCFM THEN
  525.         Macro
  526.         _SndSoundManagerVersion
  527.             dc.w     $203C
  528.             dc.w     $000C
  529.             dc.w     $0008
  530.             dc.w     $A800
  531.         EndM
  532.     ELSE
  533.         IMPORT_CFM_FUNCTION    SndSoundManagerVersion
  534.     ENDIF
  535.  
  536. ;
  537. ; pascal OSErr SndStartFilePlay(SndChannelPtr chan, short fRefNum, short resNum, long bufferSize, void *theBuffer, AudioSelectionPtr theSelection, FilePlayCompletionUPP theCompletion, Boolean async)
  538. ;
  539.     IF ¬ GENERATINGCFM THEN
  540.         Macro
  541.         _SndStartFilePlay
  542.             dc.w     $203C
  543.             dc.w     $0D00
  544.             dc.w     $0008
  545.             dc.w     $A800
  546.         EndM
  547.     ELSE
  548.         IMPORT_CFM_FUNCTION    SndStartFilePlay
  549.     ENDIF
  550.  
  551. ;
  552. ; pascal OSErr SndPauseFilePlay(SndChannelPtr chan)
  553. ;
  554.     IF ¬ GENERATINGCFM THEN
  555.         Macro
  556.         _SndPauseFilePlay
  557.             dc.w     $203C
  558.             dc.w     $0204
  559.             dc.w     $0008
  560.             dc.w     $A800
  561.         EndM
  562.     ELSE
  563.         IMPORT_CFM_FUNCTION    SndPauseFilePlay
  564.     ENDIF
  565.  
  566. ;
  567. ; pascal OSErr SndStopFilePlay(SndChannelPtr chan, Boolean quietNow)
  568. ;
  569.     IF ¬ GENERATINGCFM THEN
  570.         Macro
  571.         _SndStopFilePlay
  572.             dc.w     $203C
  573.             dc.w     $0308
  574.             dc.w     $0008
  575.             dc.w     $A800
  576.         EndM
  577.     ELSE
  578.         IMPORT_CFM_FUNCTION    SndStopFilePlay
  579.     ENDIF
  580.  
  581. ;
  582. ; pascal OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
  583. ;
  584.     IF ¬ GENERATINGCFM THEN
  585.         Macro
  586.         _SndChannelStatus
  587.             dc.w     $203C
  588.             dc.w     $0510
  589.             dc.w     $0008
  590.             dc.w     $A800
  591.         EndM
  592.     ELSE
  593.         IMPORT_CFM_FUNCTION    SndChannelStatus
  594.     ENDIF
  595.  
  596. ;
  597. ; pascal OSErr SndManagerStatus(short theLength, SMStatusPtr theStatus)
  598. ;
  599.     IF ¬ GENERATINGCFM THEN
  600.         Macro
  601.         _SndManagerStatus
  602.             dc.w     $203C
  603.             dc.w     $0314
  604.             dc.w     $0008
  605.             dc.w     $A800
  606.         EndM
  607.     ELSE
  608.         IMPORT_CFM_FUNCTION    SndManagerStatus
  609.     ENDIF
  610.  
  611. ;
  612. ; pascal void SndGetSysBeepState(short *sysBeepState)
  613. ;
  614.     IF ¬ GENERATINGCFM THEN
  615.         Macro
  616.         _SndGetSysBeepState
  617.             dc.w     $203C
  618.             dc.w     $0218
  619.             dc.w     $0008
  620.             dc.w     $A800
  621.         EndM
  622.     ELSE
  623.         IMPORT_CFM_FUNCTION    SndGetSysBeepState
  624.     ENDIF
  625.  
  626. ;
  627. ; pascal OSErr SndSetSysBeepState(short sysBeepState)
  628. ;
  629.     IF ¬ GENERATINGCFM THEN
  630.         Macro
  631.         _SndSetSysBeepState
  632.             dc.w     $203C
  633.             dc.w     $011C
  634.             dc.w     $0008
  635.             dc.w     $A800
  636.         EndM
  637.     ELSE
  638.         IMPORT_CFM_FUNCTION    SndSetSysBeepState
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal OSErr SndPlayDoubleBuffer(SndChannelPtr chan, SndDoubleBufferHeaderPtr theParams)
  643. ;
  644.     IF ¬ GENERATINGCFM THEN
  645.         Macro
  646.         _SndPlayDoubleBuffer
  647.             dc.w     $203C
  648.             dc.w     $0420
  649.             dc.w     $0008
  650.             dc.w     $A800
  651.         EndM
  652.     ELSE
  653.         IMPORT_CFM_FUNCTION    SndPlayDoubleBuffer
  654.     ENDIF
  655.  
  656. ; MACE compression routines
  657. ; MACEVersion() returns a NumVersion
  658. ;
  659. ; pascal unsigned long MACEVersion(void)
  660. ;
  661.     IF ¬ GENERATINGCFM THEN
  662.         Macro
  663.         _MACEVersion
  664.             dc.w     $203C
  665.             dc.w     $0000
  666.             dc.w     $0010
  667.             dc.w     $A800
  668.         EndM
  669.     ELSE
  670.         IMPORT_CFM_FUNCTION    MACEVersion
  671.     ENDIF
  672.  
  673. ;
  674. ; pascal void Comp3to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  675. ;
  676.     IF ¬ GENERATINGCFM THEN
  677.         Macro
  678.         _Comp3to1
  679.             dc.w     $203C
  680.             dc.w     $0004
  681.             dc.w     $0010
  682.             dc.w     $A800
  683.         EndM
  684.     ELSE
  685.         IMPORT_CFM_FUNCTION    Comp3to1
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal void Exp1to3(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  690. ;
  691.     IF ¬ GENERATINGCFM THEN
  692.         Macro
  693.         _Exp1to3
  694.             dc.w     $203C
  695.             dc.w     $0008
  696.             dc.w     $0010
  697.             dc.w     $A800
  698.         EndM
  699.     ELSE
  700.         IMPORT_CFM_FUNCTION    Exp1to3
  701.     ENDIF
  702.  
  703. ;
  704. ; pascal void Comp6to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  705. ;
  706.     IF ¬ GENERATINGCFM THEN
  707.         Macro
  708.         _Comp6to1
  709.             dc.w     $203C
  710.             dc.w     $000C
  711.             dc.w     $0010
  712.             dc.w     $A800
  713.         EndM
  714.     ELSE
  715.         IMPORT_CFM_FUNCTION    Comp6to1
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal void Exp1to6(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  720. ;
  721.     IF ¬ GENERATINGCFM THEN
  722.         Macro
  723.         _Exp1to6
  724.             dc.w     $203C
  725.             dc.w     $0010
  726.             dc.w     $0010
  727.             dc.w     $A800
  728.         EndM
  729.     ELSE
  730.         IMPORT_CFM_FUNCTION    Exp1to6
  731.     ENDIF
  732.  
  733. ; Sound Manager 3.0 and later calls
  734. ;
  735. ; pascal OSErr GetSysBeepVolume(long *level)
  736. ;
  737.     IF ¬ GENERATINGCFM THEN
  738.         Macro
  739.         _GetSysBeepVolume
  740.             dc.w     $203C
  741.             dc.w     $0224
  742.             dc.w     $0018
  743.             dc.w     $A800
  744.         EndM
  745.     ELSE
  746.         IMPORT_CFM_FUNCTION    GetSysBeepVolume
  747.     ENDIF
  748.  
  749. ;
  750. ; pascal OSErr SetSysBeepVolume(long level)
  751. ;
  752.     IF ¬ GENERATINGCFM THEN
  753.         Macro
  754.         _SetSysBeepVolume
  755.             dc.w     $203C
  756.             dc.w     $0228
  757.             dc.w     $0018
  758.             dc.w     $A800
  759.         EndM
  760.     ELSE
  761.         IMPORT_CFM_FUNCTION    SetSysBeepVolume
  762.     ENDIF
  763.  
  764. ;
  765. ; pascal OSErr GetDefaultOutputVolume(long *level)
  766. ;
  767.     IF ¬ GENERATINGCFM THEN
  768.         Macro
  769.         _GetDefaultOutputVolume
  770.             dc.w     $203C
  771.             dc.w     $022C
  772.             dc.w     $0018
  773.             dc.w     $A800
  774.         EndM
  775.     ELSE
  776.         IMPORT_CFM_FUNCTION    GetDefaultOutputVolume
  777.     ENDIF
  778.  
  779. ;
  780. ; pascal OSErr SetDefaultOutputVolume(long level)
  781. ;
  782.     IF ¬ GENERATINGCFM THEN
  783.         Macro
  784.         _SetDefaultOutputVolume
  785.             dc.w     $203C
  786.             dc.w     $0230
  787.             dc.w     $0018
  788.             dc.w     $A800
  789.         EndM
  790.     ELSE
  791.         IMPORT_CFM_FUNCTION    SetDefaultOutputVolume
  792.     ENDIF
  793.  
  794. ;
  795. ; pascal OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long *offset)
  796. ;
  797.     IF ¬ GENERATINGCFM THEN
  798.         Macro
  799.         _GetSoundHeaderOffset
  800.             dc.w     $203C
  801.             dc.w     $0404
  802.             dc.w     $0018
  803.             dc.w     $A800
  804.         EndM
  805.     ELSE
  806.         IMPORT_CFM_FUNCTION    GetSoundHeaderOffset
  807.     ENDIF
  808.  
  809. ;
  810. ; pascal UnsignedFixed UnsignedFixedMulDiv(UnsignedFixed value, UnsignedFixed multiplier, UnsignedFixed divisor)
  811. ;
  812.     IF ¬ GENERATINGCFM THEN
  813.         Macro
  814.         _UnsignedFixedMulDiv
  815.             dc.w     $203C
  816.             dc.w     $060C
  817.             dc.w     $0018
  818.             dc.w     $A800
  819.         EndM
  820.     ELSE
  821.         IMPORT_CFM_FUNCTION    UnsignedFixedMulDiv
  822.     ENDIF
  823.  
  824. ;
  825. ; pascal OSErr GetCompressionInfo(short compressionID, OSType format, short numChannels, short sampleSize, CompressionInfoPtr cp)
  826. ;
  827.     IF ¬ GENERATINGCFM THEN
  828.         Macro
  829.         _GetCompressionInfo
  830.             dc.w     $203C
  831.             dc.w     $0710
  832.             dc.w     $0018
  833.             dc.w     $A800
  834.         EndM
  835.     ELSE
  836.         IMPORT_CFM_FUNCTION    GetCompressionInfo
  837.     ENDIF
  838.  
  839. ;
  840. ; pascal OSErr SetSoundPreference(OSType theType, Str255 name, Handle settings)
  841. ;
  842.     IF ¬ GENERATINGCFM THEN
  843.         Macro
  844.         _SetSoundPreference
  845.             dc.w     $203C
  846.             dc.w     $0634
  847.             dc.w     $0018
  848.             dc.w     $A800
  849.         EndM
  850.     ELSE
  851.         IMPORT_CFM_FUNCTION    SetSoundPreference
  852.     ENDIF
  853.  
  854. ;
  855. ; pascal OSErr GetSoundPreference(OSType theType, Str255 name, Handle settings)
  856. ;
  857.     IF ¬ GENERATINGCFM THEN
  858.         Macro
  859.         _GetSoundPreference
  860.             dc.w     $203C
  861.             dc.w     $0638
  862.             dc.w     $0018
  863.             dc.w     $A800
  864.         EndM
  865.     ELSE
  866.         IMPORT_CFM_FUNCTION    GetSoundPreference
  867.     ENDIF
  868.  
  869. ; Sound Manager 3.1 and later calls
  870. ;
  871. ; pascal OSErr SndGetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  872. ;
  873.     IF ¬ GENERATINGCFM THEN
  874.         Macro
  875.         _SndGetInfo
  876.             dc.w     $203C
  877.             dc.w     $063C
  878.             dc.w     $0018
  879.             dc.w     $A800
  880.         EndM
  881.     ELSE
  882.         IMPORT_CFM_FUNCTION    SndGetInfo
  883.     ENDIF
  884.  
  885. ;
  886. ; pascal OSErr SndSetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  887. ;
  888.     IF ¬ GENERATINGCFM THEN
  889.         Macro
  890.         _SndSetInfo
  891.             dc.w     $203C
  892.             dc.w     $0640
  893.             dc.w     $0018
  894.             dc.w     $A800
  895.         EndM
  896.     ELSE
  897.         IMPORT_CFM_FUNCTION    SndSetInfo
  898.     ENDIF
  899.  
  900.  
  901.     ENDIF ; __SOUND__
  902.